import request from '@/utils/request'

export default {
  // 查询所有知识点的id和名称
  getConceptsIdAndName(){
    return request({
      url: `/concept/getConceptsIdAndName`,
      method: 'get'
    })
  },
  // 查询所有知识点的id和名称
  getConceptById(conceptId){
    return request({
      url: `/concept/getConceptById/${conceptId}`,
      method: 'get'
    })
  },
  // 组合条件查询知识点信息
  getConceptsPage(current, limit, conceptQuery) {
    return request({
      url: `/concept/getConceptsPageCondition/${current}/${limit}`,
      method: 'post',
      data: conceptQuery
    })
  },
  // 删除该知识点，及该知识点下的所有子信息
  deleteConcept(conceptId) {
    return request({
      url: `/concept/deleteConcept/${conceptId}`,
      method: 'delete',
    })
  },
  // 修改课程信息
  updateConcept(concept) {
    return request({
      url: `/concept/updateConcept`,
      method: 'put',
      data: concept
    })
  },
  // 增加新的课程
  addConcept(concept) {
    return request({
      url: `/concept/addConcept`,
      method: 'post',
      data: concept
    })
  },
  // 根据知识点id查询关联知识点列表
  getNextConceptList(conceptId){
    return request({
      url: `/conceptRelation/getNextConceptList/${conceptId}`,
      method: 'get'
    })
  },
  // 根据知识点id查询可以添加的关联知识点列表
  getCanBeAddedNextConceptList(currentConceptId,courseId){
    return request({
      url: `/conceptRelation/getCanBeAddedNextConceptList/${currentConceptId}/${courseId}`,
      method: 'get'
    })
  },
  // 增加新的关联知识点
  addConceptRelation(nextConcept){
    return request({
      url: `/conceptRelation/addConceptRelation`,
      method: 'post',
      data:nextConcept
    })
  },
  // 删除关联知识点
  deleteConceptRelation(conceptId,nextConceptId){
    return request({
      url: `/conceptRelation/deleteConceptRelation/${conceptId}/${nextConceptId}`,
      method: 'delete',
    })
  },
}
